import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 获取本地维修历史table
export const getfindAllRepairTypeList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedataRepairtypes/findAllRepairType`, {
    params
  });
// 获取所有权限维修类型
export const getfindAllRepairTypeListForAuth = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedataRepairtypes/findAllRepairTypeForAuth`, {
    params
  });

export const getbrandsdictList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/baseData/repair/brandSelect`, {
    params
  });
export const getlabourpriceList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedataRepairtypes/labourpriceItem`, {
    params
  });
export const getfindInvoiceCodeList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairEstimate/findInvoiceCode`, {
    params
  });
// 获取估价单表格数据
export const getrepairEstimateNOList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairEstimate/repairEstimateNO`, {
    params
  });
// 获取车主信息
export const getownerList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairEstimate/owner`, {
    params
  });
// 添加车主
export const setowner = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/customerCare/ownerVehicleManagement/addOwner`, params);
// 获取车系
export const getseriessdictList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/baseData/repair/${params.brand}/seriesSelect`, {
    params
  });
// 根据车系品牌获取车型
export const getmodelsdictList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/baseData/repair/${params.brand}/${params.series}/modelSelect`, {
    params
  });
// 获取优惠模式
export const getqueryDiscountModeList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/discountmodes/queryDiscountMode`, {
    params
  });
// 获取维修项目
export const getroLabourByestimateNOList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairEstimate/roLabourByestimateNO/${params.code}`, {
    params
  });
// 获取维修工具
export const getEvaluationList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairEstimate/getEvaluationList/${params.code}`, {
    params
  });
// 获取维修材料
export const getpartByestimateNOList = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairEstimate/partByestimateNO/${params.code}`, {
    params
  });
// 附加项目
export const getaddItemByestimateNO = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/repairEstimate/addItemByestimateNO/${params.code}`, {
    params
  });
// 外饰颜色
export const getOuterColorList = params => axios.get(`${SERVER.BASEDATA}/vehicleProduct/colors/colorinfo/exterior`);

/**
 * 重构新增
 */

// 保存估价单
export const saveRepairEstimateOrder = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/basedata/cmsRepairEstimate/saveRepairEstimateOrder`, params);

// 估价单查询
export const queryRepairEstimateOrder = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/cmsRepairEstimate/queryRepairEstimateOrder`, {
  params
});

// 估价单详情
export const queryRepairEstimateOrderDetail = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/cmsRepairEstimate/queryRepairEstimateOrderDetail`, {
  params
});

// 估价单作废
export const discardRepairEstimateOrder = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/basedata/cmsRepairEstimate/discardRepairEstimateOrder`, params);

// 打印结算单
export const printSettlementEstimateOrder = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/cmsRepairEstimate/printSettlementEstimateOrder`, { params });

// 打印工单（估价单）
export const printRepairEstimateOrder = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/cmsRepairEstimate/printRepairEstimateOrder`, { params });
